import React, { Component } from 'react';
import Mentions from './components/mentions';
import './App.css';

export default class App extends Component {

  state = {
    mentionValues: ['zhangsan', 'lisi'],
    mentionNameList: ['zhangsan', 'lisi', 'wangmazi'],
  };

  onMentionsChange (newValues) {
    this.setState({
      mentionValues: newValues,
    });
  }

  render () {

    return (
      <>
        <Mentions
          values={ this.state.mentionValues }
          nameList={ this.state.mentionNameList }
          onChange={ this.onMentionsChange.bind(this) }
        />
      </>
    );
  }

}
